import java.io.*;

	/**
	* @author Joshua Oberle.
	*/

public class LogFileReader{

	/**
	* This class helps pass log lines into the database.
	*
	* The class is mearly a front end for the LogLineReader class. The program
	* will continue to take input until null is entered. Primary use is to have files
	* piped into this class.
	*/

	public static void main(String[] args){
		LogLineReader llr = new LogLineReader();
		try{
			while(true){
				StringBuilder line = new StringBuilder();
				int letter;
				while(true){
					letter = System.in.read();
					if(letter > -1){
						if((char) letter == '\n' || (char) letter == '\r')
							break;
						line.append((char) letter);
					}else{
						break;
					}//no more file
				}//while there is more line to read
				if(letter < 0)
					break;
				llr.nextLine(line.toString());
			}//while there is more to file to read
			llr.writeToDatabase();
		}catch(Exception e){
			e.printStackTrace();
		}//catch
	}//main(String[])

}//class LogFileReader